The present invention relates to a method of controlling, employed in stepping motors or servomotors, a position of an object.
As the first background art relating to the positioning control method, for example, a technique described in Japanese Patent Application Laid-Open No. 4-172506 can be mentioned. In this technique, when an object is to be shifted to a specified position, the object is accelerated up to a target velocity, shifted at the target velocity, then decelerated and stopped, to thereby perform positioning. The acceleration time at that time is set for each time frame (obtained by dividing a target distance by a target velocity).
With regard to this control method, an example in which the distance (instructed distance) of the object is 400 [pulses], and the target velocity is 50 per unit time [pulse/sec] is explained below.
The distance 400 [pulses] is divided by the target velocity 50 [pulses/sec], to thereby divide the distance into 8 unit time frames A to H, respectively having the distance of 50 [pulses].
Acceleration time is specified for the respective unit time frames. Here, when the same acceleration time (5 seconds) is assumed for all time frames, the distance 50 [pulses] in the unit time frame A is uniformly divided into the acceleration time 5 seconds, and reallocated to continuous five unit time frames A, B, C, D, and E by 10 [pulses], in order of the unit time frame A as a top.
Similarly, reallocation is sequentially performed, with the time frame to be reallocated shifted backwards by one, for the distance 50 [pulses] of the respective unit time frames (B to F, C to G, . . . ). When the reallocated time frame is not 5 unit time, a unit time frame having a distance 0 [pulse] is newly added, and reallocated.
When reallocation is finished, the reallocated distance is summed up for each unit time frame, to realize the initially specified shift.
As the second background art, a technique described in Japanese Patent Application Laid-Open No. 11-220364 can be mentioned. In this technique, the velocity control of the object is realized by generating an output pulse having an optional frequency proportional to an optional set value.
In this control method, at first, the number of times of acceleration within the acceleration time is determined according to the set rate of acceleration, and when the expected value agrees with the number of times the object is accelerated, the velocity is switched to a constant rate, and thereafter, decelerated with the same gradient as that of the acceleration.
As the third background art, there is a positioning control method, in which the distance of the object is allocated in an acceleration region, a constant rate (target velocity) region, and a deceleration region, and the velocity change is performed by comparing the current value (the distance that the object has been shifted) with the instructed distance for each control cycle.
In this control method, when acceleration is performed for each of predetermined control cycles, and the target velocity (or the distance in the acceleration region) is attained, constant-rate shift is performed at the target velocity. During this time, a comparison is made between the current value and the deceleration-start distance (obtained by subtracting the distance allocated to the deceleration region from the instructed distance) for each control cycle. When the current value reaches the deceleration-start distance, deceleration up to the target position is started, to thereby perform deceleration for each control cycle.
In the first and second background art, the deceleration time depends on the acceleration time, and only the deceleration time cannot be changed. Therefore, there is a problem in that it cannot deal with demands of performing positioning control of a machine slowly, with only the deceleration time extended, according to the desire of a user.
In the second background art, the distance is not taken into consideration, and since a method for determining the deceleration-start distance is not described, there is a problem in that accurate positioning cannot be performed.
In the third background art, calculation of distance with respect to the acceleration region, the target velocity region, and the deceleration region must be performed on a computing unit (or CPU) side that outputs the velocity instruction for each control cycle, and hence the load on the computing unit (or CPU) increases.
In the third background art, since a comparison of distance is made for each control cycle, it is quite unusual that the current value agrees with the deceleration-start distance at a break in the control cycle, and in most cases, the current value reaches the deceleration-start distance during the control cycle. Therefore, there is a problem in that optimization of the control cycle must be performed in order to start deceleration at an optimum timing.
In the third background art, when acceleration, constant rate and deceleration are to be switched, the current value (the velocity at which the object is moving) is compared with the target velocity, thereby causing a problem in that when the velocity value to be compared increases, the number of comparison circuits and gates also increases, and a large memory space is required for storing the distance allocated to the acceleration region, the constant rate region, and the deceleration region.
Therefore, it is an object of the present invention to provide a positioning control method capable of setting of the deceleration time independently of the acceleration time, and capable of performing accurate positioning.
It is another object of the present invention to provide a positioning control method for suppressing the load on the computing unit, and capable of reducing the number of circuits and gates, and memory space.
The positioning control method according to the present invention, in which an object is accelerated up to a target velocity VS, and then decelerated, to thereby perform position control of the object at a position shifted by a predetermined distance YS, by providing an output pulse of a frequency corresponding to an instructed velocity Vp to the object, includes a deceleration-start distance calculation step of executing processing for obtaining a deceleration-start distance YSd, being a distance until deceleration of the object is started, and being a sum of an integer part YSdq of the deceleration-start distance and a decimal part YSdr of the deceleration-start distance, separately for each of the integer part YSdq and the decimal part YSdr, with the integer part YSdq being in a unit of one pulse of the output pulse, and the decimal part YSdr being in a unit of 1/D1 pulse, when it is assumed that a control frequency is denoted by fc, the minimum velocity of the output pulse is denoted by 1/n, the number of seconds is denoted by n, and D1=fcxc3x97n, before executing acceleration control of the object; and a deceleration-start point judgment step of judging a point in time when a value obtained by counting the output pulse becomes equal to or greater than the integer part YSdq obtained above, and the result of addition xcex81 obtained by adding a velocity set value (VPxc3x97n) for each 1/fc time becomes equal to or greater than the value YSdR obtained by rounding off the decimal part YSdr to the nearest integer, as a deceleration start time, and starting deceleration from the judgment point.
At the deceleration-start distance calculation step, the deceleration-start distance YSd is calculated by subtracting a shifted distance Yd in the deceleration interval from the distance YS, and the shifted distance Yd in the deceleration interval is calculated by subtracting a distance decreased than that of the constant rate by deceleration, from the distance when the object is shifted by deceleration time td at the target velocity VS.
At the deceleration-start distance calculation step, when it is assumed that the object is decelerated by a velocity variation xcex94Vd for each time interval xcex94td (=td/xcex1d, xcex1d; division number), during the deceleration time td, the deceleration-start distance YSd is calculated based on the calculation of the number of (xcex94Vdxc3x97xcex94td), by using a computational expression of arithmetic series.
The integer part YSdq and the YSdR obtained by rounding off the decimal part YSdr to the nearest integer of the deceleration-start distance are determined by the following equations:                               YSdq          =                    ⁢                      quotient            ⁢                          xe2x80x83                        ⁢                          of              ⁢                                                xe2x80x83                                ⁢                                  xe2x80x83                                            (                                                2                  xc3x97                  f                  ⁢                                      xe2x80x83                                    ⁢                  c                  xc3x97                  n                  xc3x97                  YS                                -                                                                                            ⁢                                    (                                                2                  xc3x97                  VS                  xc3x97                  n                                -                                  Δ                  ⁢                                      xe2x80x83                                    ⁢                  Vd                  xc3x97                  n                  xc3x97                                      (                                                                  α                        ⁢                                                  xe2x80x83                                                ⁢                        d                                            +                      1                                        )                                                              )                        xc3x97                                                                                                                  ⁢                                  Δ                  ⁢                                      xe2x80x83                                    ⁢                  t                  ⁢                                      xe2x80x83                                    ⁢                  d                  xc3x97                  α                  ⁢                                      xe2x80x83                                    ⁢                  d                                )                            /                              (                                  2                  xc3x97                  f                  ⁢                                      xe2x80x83                                    ⁢                  c                  xc3x97                  n                                )                                      ≥                          0              ⁢                              xe2x80x83                            [              pulse              ]                                ;                                                  YSdR          =                    ⁢                      quotient            ⁢                          xe2x80x83                        ⁢            ofb            ⁢                          xe2x80x83                        ⁢                          (                              surplus                ⁢                                  xe2x80x83                                ⁢                of                ⁢                                  xe2x80x83                                ⁢                                  (                                                            2                      xc3x97                      f                      ⁢                                              xe2x80x83                                            ⁢                      c                      xc3x97                      n                      xc3x97                      YS                                        -                                                                                                                              ⁢                                    (                                                2                  xc3x97                  VS                  xc3x97                  n                                -                                  Δ                  ⁢                                      xe2x80x83                                    ⁢                  Vd                  xc3x97                  n                  xc3x97                                      (                                                                  α                        ⁢                                                  xe2x80x83                                                ⁢                        d                                            +                      1                                        )                                                              )                        xc3x97                                                                                                                                                            ⁢                                          Δ                      ⁢                                              xe2x80x83                                            ⁢                      t                      ⁢                                              xe2x80x83                                            ⁢                      d                      xc3x97                      α                      ⁢                                              xe2x80x83                                            ⁢                      d                                        )                                    /                                      (                                          2                      xc3x97                      f                      ⁢                                              xe2x80x83                                            ⁢                      c                      xc3x97                      n                                        )                                                  )                            /              2                        ≥                          0              ⁢                              xe2x80x83                            [                                                (                                      1                    /                                          (                                              f                        ⁢                                                  xe2x80x83                                                ⁢                        c                        xc3x97                        2                                            )                                                        )                                ⁢                                  xe2x80x83                                ⁢                pulse                            ]                                ,                    
where the minimum velocity of the output pulse is multiplied by n in order to display the minimum velocity of the output pulse in an integer, the minimum velocity is expressed by 1 [(1/n) pulse/sec], n denotes the number of seconds, and xcex1d is a division number of deceleration time td into xcex94td/fc [(1/fc) sec].
The positioning control method further comprises an acceleration and constant rate step of changing the frequency of the output pulse to thereby accelerate the velocity of the object until the velocity of the object reaches the target velocity VS, and thereafter driving the object at the target velocity VS, which is a step executed after the deceleration-start distance calculation step and before the deceleration start time judgment step.